module client.GateServerClient;

import std.stdio;
import msgtrans;
import hunt.logging;

class GateServerClient {

  private __gshared GateServerClient _instance;

  private TransportSession[ulong] _forwardClientMap;

  private uint _size = 0;

  static public GateServerClient getInstance()
  {
    if (_instance is null)
    {
      _instance = new GateServerClient();
    }
    return _instance;
  }

  public void addForwardClient(TransportContext client,ulong id)
  {
    if (id in _forwardClientMap)
    {
      logErrorf("gateServer id(%d) have exist!", id);
    }

    _forwardClientMap[id] = client.session();
    _size += 1;
  }

  public TransportSession[ulong] getForwardClient()
  {
    return _forwardClientMap;
  }
}

